class Solution {
public:
    int findMin(vector<int>& nums) {
        if(nums.size() == 1)return nums[0];
        int low = 0, high = nums.size() - 1;
        while(high - low > 1){
            int mid = (low + high) / 2;
            if(nums[low] < nums[high])return nums[low];
            if(nums[mid] > nums[low])low = mid + 1;
            else high = mid;
        }
        return min(nums[low], nums[high]);
    }
};

//2021.4.8
